# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-apispec
pkgver=6.0.2
pkgrel=2
pkgdesc="A pluggable API specification generator. Currently supports the OpenAPI Specification."
url="https://github.com/marshmallow-code/apispec"
license=('MIT')
arch=('any')
depends=('python-packaging')
optdepends=('python-yaml: for yaml support'
            'python-prance: for validation'
            'python-openapi-spec-validator: for validation')
makedepends=('python-setuptools')
checkdepends=('python-pytest-runner' 'python-tornado' 'python-bottle' 'python-marshmallow'
              'python-flask' 'python-prance' 'python-yaml'
              'python-openapi-spec-validator')
source=("$pkgname-$pkgver.tar.gz::https://github.com/marshmallow-code/apispec/archive/$pkgver.tar.gz")
sha512sums=('aa5e2cc41d5b3c4555da929819135df30192e6f6ff08518d62674495f0d28c14e51a0aa111b289e5f9d7205f821c1fd4e28b914899ea3e15b3e20f6052258117')

build() {
  cd apispec-$pkgver
  python setup.py build
}

check() {
  cd apispec-$pkgver
  python setup.py pytest
}

package() {
  cd apispec-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
